<admintpl file="header" />
<script src="__PUBLIC__/layer/layer.js"></script>
</head>
<body>
	<div class="wrap js-check-wrap">
		<!--<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">巡检记录</a></li>
			<li><a href="{:U('Maclistadmin/add')}" target="_self">{:L('ADD')}</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('Maclistadmin/ssearch')}">		
			设备编号： 
			<input type="text" name="keyword" style="width: 200px;"  placeholder="请输入准确无误的设备编号">
			<input type="submit" class="btn btn-primary" value="搜索" />
		</form>-->
		<form class="js-ajax-form" action="" method="post">
			<div class="table-actions">				
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Slistadmin/delete')}" data-subcheck="true" data-msg="你确定删除吗？">{:L('DELETE')}</button>
				<button class="btn btn-primary btn-small js-articles-move" type="button">批量移动</button>
			</div>
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
						<th width="50">序号</th>
						<th width="50">网络传输设备</th>
						<th width="50">影像平台服务器</th>
						<th width="50">网络设备</th>	
						<th width="50">UPS</th>
						<th width="50">发电机</th>
						<th width="50">机房空调</th>	
						<th width="50">机房环境监控</th>	
						<th width="80">巡检人</th>						
						<th width="80">巡检日期</th>
						<th width="70">图片</th>						
						<th width="70">操作</th>
					</tr>
				</thead>
				<php>
				$status=array("1"=>"已审核","0"=>"未审核");
				$top_status=array("1"=>"已置顶","0"=>"未置顶");
				$recommend_status=array("1"=>"已推荐","0"=>"未推荐");
				</php>
				<foreach name="lists" item="vo">
				<tr>
					<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}" title="ID:{$vo.id}"></td>					
					<td><a href="javascript:void(0)" onclick="iframe('{:U('Maclistadmin/showinfo',array('id'=>$vo['id']))}')"><span>{$vo.id}</span></a></td>
					<td>{$vo.wlcssb}</td>
					<td>{$vo.yxptfwq}</td>
					<td>{$vo.wlsb}</td>
					<td>{$vo.ups}</td>
					<td>{$vo.fdj}</td>					
					<td>{$vo.jfkt}</td>
					<td>{$vo.jfhjjk}</td>
					<td>{$vo.xjr}</td>
					<td>{$vo.gzrq}</td>
					<td>
						<php>$smeta=json_decode($vo['smeta'],true);</php>
						<foreach name="smeta['photo']" item="voo" key="key">											    								
						<if condition="!empty($voo['url'])">
							<a href="__UPLOAD__{$voo['url']}" target='_blank'>图片[{$key+1}]</a>&nbsp&nbsp
						</if>
						</foreach>						
					</td>					
					<td>
						<a href="{:U('Maclistadmin/edit',array('id'=>$vo['id']))}">{:L('EDIT')}</a> | 
						<a href="{:U('Maclistadmin/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a></td>
				</tr>
				</foreach>				
			</table>			
			<div class="pagination" style="float:right">&nbsp&nbsp共【{$lists_count}】条记录{$Page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>		
		
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "{:U('AdminPost/index',$formget)}";
			}
		}
		setInterval(function() {
			refersh_window();
		}, 2000);
		$(function() {
			setCookie("refersh_time", 0);
			Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
				//批量移动
				$('.js-articles-move').click(function(e) {
					var str = 0;
					var id = tag = '';
					$("input[name='ids[]']").each(function() {
						if ($(this).attr('checked')) {
							str = 1;
							id += tag + $(this).val();
							tag = ',';
						}
					});
					if (str == 0) {
						art.dialog.through({
							id : 'error',
							icon : 'error',
							content : '您没有勾选信息，无法进行操作！',
							cancelVal : '关闭',
							cancel : true
						});
						return false;
					}
					var $this = $(this);
					art.dialog.open("__ROOT__/index.php?g=portal&m=AdminPost&a=move&ids="+ id, {
						title : "批量移动",
						width : "80%"
					});
				});
			});
		});
		function iframe(url){
			layer.open({
	        type: 2,
	        title: '巡检详细信息',
	        shadeClose: true,
	        shade: 0.5,
	        area: ['1000px', '570px'],
	        content: url
	     });
	    }
	</script>
</body>
</html>